/**
 * 
 */
package com.chocolatefordogs.writersnb.core.ui;

import javax.swing.JFrame;

import com.chocolatefordogs.writersnb.core.ApplicationState;

/**
 * Base class for windows in the project.  This implementation
 * forces construction with an {@link ApplicationState} instance
 * and provides basic access to the instance to subclasses.
 *  
 * @author Matthew Cory
 */
public abstract class BaseFrame extends JFrame {
	
	public BaseFrame(final ApplicationState applicationState) {
		if (applicationState == null) {
			throw new IllegalArgumentException("Application state must be provided.");
		}
		
		this.applicationState = applicationState;
	}
	
	protected final ApplicationState getApplicationState() {
		return applicationState;
	}

	private final ApplicationState applicationState;
}
